import JWT from 'jsonwebtoken'
import {H3Event} from 'h3'
export const getUserFromJwt = (e:H3Event) => {
  const jwt = e.node.req.headers.authorization ?? ''
  const info = JWT.verify(jwt, process.env.JSON_SECRET)
  const {id} = info
  return id
}